package com.songshuai.webapi.permission.dao;

import com.songshuai.webapi.permission.dto.po.UserIdsForRolePojo;
import com.songshuai.webapi.permission.dto.po.UsersResPojo;
import com.songshuai.webapi.permission.dto.request.Departments.*;
import com.songshuai.webapi.permission.dto.response.UsersResDto;
import com.songshuai.webapi.permission.model.YxDepartmentUser;
import com.songshuai.webapi.permission.model.YxDepartments;
import com.songshuai.webapi.permission.model.YxUsers;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * YxDepartmentUserMapper继承基类
 */

public interface YxDepartmentUserMapper  {

    //查询用户名是否存在
    YxUsers selectUsers(YxUsers yxUsers);
    //查询用户列表
    List<YxUsers> queryUsersForStr(@Param("ids")  String[] ids);
    //查询部门用户
    List<UsersResDto> selectUsersForDeparent(UserListReqDto userList);
    //查询部门用户总条数
    Integer selectUsersForDeparentCount(UserListReqDto userList);
    //插入用户
    Integer insertUser(AddDepartmentUserReqDto addDepartmentUserReqDto);
    //插入部门
    Integer insertDepartmentUser(YxDepartmentUser yxDepartmentUser);
    //查询用户角色列表
    List<UsersResDto> selectUserRoles(UserRolesReqDto userRolesReqDto);
    //删除用户部门关系
    Integer deleteDepartmentUserByUserId(Integer userId);
    //查找子部门SQL
    String selectSubDepartmentSql(Integer parentId);
    //查找子部门
    List<Integer> selectSubDepartment(Integer parentId);
    //设置部门领导
    Integer updateDepartmentsLeader(UpdateDepartmentsLeaderReqDto updateDepartmentsLeaderReqDto);
    //删除部门领导
    Integer deleteDepartmentLeader(Integer departmentId);
    //设置部门领导-人员列表
    List<UsersResPojo> selectDepartmentsLeaderUserList(UpdateDepartmentsLeaderUserListReqDto updateDepartmentsLeaderUserListReqDto);
    //设置部门领导-回填人员列表
    List<UsersResPojo> updateDepartmentsLeaderBackUserList(UpdateDepartmentsLeaderBackUserListReqDto updateDepartmentsLeaderBackUserListReqDto);
    //调入已有用户/设置部门关系-人员列表
    List<UsersResPojo> updateUserDepartmentUserList(UpdateUserDepartmentUserListReqDto updateUserDepartmentUserListReqDto);
    //调入已有用户/设置部门关系-人员列表Sub
    List<YxDepartments> updateUserDepartmentUserListSub(UpdateUserDepartmentUserListReqDto updateUserDepartmentUserListReqDto);

    //根据参数查询用户部门关联实体
    YxDepartmentUser queryDepartUserByParam(YxDepartmentUser yxDepartmentUser);

    /**
     * 根据实体查询
     * @param yxDepartmentUser
     * @return
     */
    List<YxDepartmentUser> selectByEntityList(YxDepartmentUser yxDepartmentUser);

    //所有用户列表
    List<UsersResPojo> getAllUsers(AllUsersReqDto allUsersReqDto);

    List<Integer> queryUserIdsByDeptId(UserIdsForRolePojo userIdsForRolePojo);
}